from contextlib import asynccontextmanager
from fastapi import FastAPI


@asynccontextmanager
async def lifespan(app: FastAPI):
    # 启动调度器
    print('启动项目')
    # 更新所有订单状态为取消
    # all_status_update_task("all_status_update", datetime.datetime.now() + datetime.timedelta(seconds=10), [])
    # 应用关闭时的处理
    yield
    print('end')
    # 关闭调度器
